import tensorflow as tf 
import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt 
import os,sys
input_size=4
DropoutRate=0.5
hidden_num=100
indata=pd.read_excel('example.xlsx',usecols=[0,1,2,3])
outdata=pd.read_excel('example.xlsx',usecols=[4])
input_data=indata.values
output_data=outdata.values
#print(input_data)
#print(output_data)

model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(units=input_size))
model.add(tf.keras.layers.BatchNormalization())
model.add(tf.keras.layers.Dense(hidden_num,activation='sigmoid',kernel_initializer='he_normal'))
model.add(tf.keras.layers.BatchNormalization())
model.add(tf.keras.layers.Dropout(rate=DropoutRate))
model.add(tf.keras.layers.Dense(1,kernel_initializer='he_normal'))
model.compile(loss='mse',optimizer='Adam')


NUM_EPOCHS=20;
model.fit(input_data,output_data,validation_split=0.1,shuffle=True,verbose=2,epochs=NUM_EPOCHS)
model.save('m2.h5')

prediction=model.predict([[-40,300,300,300]])
print(prediction)